We consider an incompressible fluid in a three-dimensional pipe, following the Navier-Stokes system with classical boundary conditions. We are interested in the following question: is there any optimal shape for the criterion "energy dissipated by the fluid"? Moreover, is the cylinder the optimal shape? We prove that there exists an optimal shape in a reasonable class of admissible domains, but the cylinder is not optimal. For that purpose, we explicit the first order optimality condition, thanks to adjoint state and we prove that it is impossible that the adjoint state be a solution of this over-determined system when the domain is the cylinder. At last, we show some numerical simulations for that problem.